<template>
	<view>
		<view class="bgfff pb30">
			<view class="plr30 box_b">
				<view class="flex_start flex_items f30 bold pt30">
					<view class="color1">*</view>
					<view>账号</view>
				</view>
				<input class="ipt plr20 box_b" placeholder="请输入账号" />
			</view>
			<view class="plr30 box_b mt30">
				<view class="flex_start flex_items f30 bold pt30">
					<view class="color1">*</view>
					<view>密码</view>
				</view>
				<input class="ipt plr20 box_b" type="password" placeholder="请输入密码" />
			</view>
		</view>
		<view class="flex_center flex_items pt40">
			<view @click="submit" class="btn1 flex_center flex_items f32 bold cf">登录</view>
		</view>
	</view>
</template>
<script>
	let common = getApp().globalData.commonFun;
	let util = getApp().globalData.utilFun;
	export default {
		components: {},
		data() {
			return {
				imghttp: getApp().globalData.imghttp,
				name: '',
				phone: "",
			}
		},
		async onLoad() {

		},
		methods: {
			async submit() {
				let val = {
					name: this.name,
					phone: this.phone,
				}
				if (this.name == "") {
					common.showTimeToast('请输入账号');
					return;
				}

				if (this.phone == "") {
					common.showTimeToast('请输入密码');
					return;
				}
				let url = 'arts/save';
				util.showLoading("...");
				let res = await util.httpRequest(url, val, "POST");
				common.hideLoading();
				if (res.result == "fail") {
					common.showTimeToast(res.msg);
					return;
				}
				common.showTimeToast("登录成功");
				setTimeout((rs) => {
					uni.redirectTo({
						url: "/pages/enrollList/enrollList"
					})
				}, 2000)
			},
		},
	}
</script>


<style>
	page {
		background: #ffffff;
	}
</style>
<style scoped>
	Page {
		background: #ffffff;
	}

	.color1 {
		color: #ff0050;
	}

	.ipt {
		width: 100%;
		height: 80rpx;
		border-radius: 10rpx;
		border: 1px solid #eeeeee;
		margin-top: 5rpx;
	}

	.btn1 {
		width: 600rpx;
		height: 90rpx;
		border-radius: 15rpx;
		background: #3b63fe;
		border: 1px solid #3b63fe;
	}
</style>